package demo2;

import java.util.Scanner;

public class Main{
    static int[][] map;
    static long count = 0;
    static int n,m;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextInt()) {
            n = scanner.nextInt();
            m = scanner.nextInt();
            map = new int[n+1][m+1];
            int k = scanner.nextInt();
            for(int i = 0; i<k ;i++) {
                int a = scanner.nextInt();
                int b = scanner.nextInt();
                map[a][b]= 1;
            }
            //计算总共有多少种走法
            long[][] dp = new long[n+1][m+1];

            dp[1][0] = 1;
            for(int i = 1; i<=n; i++) {
                for(int j = 1; j<=m; j++) {
                    dp[i][j] = dp[i-1][j] + dp[i][j-1];
                }
            }
            long sum = dp[n][m];

            //计算有多少种合法的走法
            dp = new long[n+1][m+1];
            dp[1][0] = 1;
            for(int i = 1; i<=n; i++) {
                for(int j = 1; j<=m; j++) {
                    if(map[i][j]== 1) dp[i][j]= 0;
                    else dp[i][j]= dp[i-1][j]+ dp[i][j-1];
                }
            }
            count = dp[n][m];

            System.out.println(sum);
            System.out.println(count);

            double res = count*1.0f/sum;
            System.out.printf("%.2f\n", res);
        }
    }

}